_base_ = '../yolov5/ins_seg/yolov5_ins_s-v61_syncbn_fast_8xb16-300e_coco_instance.py'  # noqa

max_epochs = 150
data_root = 'data/sewer/'

class_name = ('aj','cj','ck','cq','pl','sg','sl','tl','zw')  # 根据 class_with_id.txt 类别信息，设置 class_name
num_classes = len(class_name)
metainfo = {
    'classes': ('aj','cj','ck','cq','pl','sg','sl','tl','zw'),
    'palette': [
        (220, 20, 60),
        (0, 255, 0),
        (0, 0, 255),
        (255, 255, 0),
        (255, 0, 255),
        (0, 255, 255),
        (128, 0, 128),
        (255, 165, 0),
        (128, 128, 0)
    ]
}


# dataloader 加载进程数
train_num_workers = 2
log_interval = 1
#####################
train_dataloader = dict(
    batch_size=48,
    num_workers=train_num_workers,
    dataset=dict(
        data_root=data_root,
        metainfo=metainfo,
        data_prefix=dict(img='images/'),
        ann_file='annotations/trainval.json'))
val_dataloader = dict(
    batch_size=48,
    dataset=dict(
        data_root=data_root,
        metainfo=metainfo,
        data_prefix=dict(img='images/'),
        ann_file='annotations/test.json'))
test_dataloader = val_dataloader
val_evaluator = dict(ann_file=data_root + 'annotations/test.json')
test_evaluator = val_evaluator
default_hooks = dict(logger=dict(interval=log_interval))
#####################

model = dict(bbox_head=dict(head_module=dict(num_classes=num_classes)))

_base_.visualizer.vis_backends = [dict(type='LocalVisBackend'), dict(type='WandbVisBackend')]